package icu.groot.alan.hotel.util;
/**
 * 返回前端状态枚举类
 */
public enum ResultCodeEnum implements ResultCodeEnumInterface{

    /**
     * 200+ 成功
     */
    SUCCESS(200, "请求成功"),

    /**
     * 300+ 权限
     */
    TOKEN_FAILED(301, "登录过期, 请重新登录"),
    TOKEN_FAILED_ADMIN(302, "登录过期, 请重新登录"),

    /**
     * 400+ 业务异常,或操作失败
     */
    FAILED(400, "操作失败"),
    FAILED_LOGIN_ACCOUNT(401, "登录失败,用户不存在"),
    FAILED_LOGIN_PASSWORD(402, "登录失败,密码错误"),

    /**
     * 600+ 系统异常
     */
    SYSTEM_EXCEPTION(600, "操作异常，请重试");

    /**
     * 错误码
     */
    private final Integer code;

    /**
     * 错误描述
     */
    private String message;


    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    @Override
    public ResultCodeEnum setMessage(String message) {
        this.message = message;
        return this;
    }

}
